package kr.hkit.powerjava.chapter07.work;

//사각형 나타내기
class Rectangle {
	int w;
	int h;

	public Rectangle(int w, int h) {
		super();
		this.w = w;
		this.h = h;

	}

	public int getW() {
		return w;
	}

	public void setW(int w) {
		this.w = w;
	}

	public int getH() {
		return h;
	}

	public void setH(int h) {
		this.h = h;
	}

	int area() { // 사각형 넓이반환
		return w * h;
	}

	int perimeter() { // 사각형 둘레반환
		return (w + h) * 2;
	}

}

public class Prog1 {
	public static void main(String[] args) {
		Rectangle myRec = new Rectangle(0, 0);
		myRec.setH(15);
		myRec.setW(60);
		System.out.println("넓이" + myRec.area());
		System.out.println("둘레" + myRec.perimeter());
	}

}
